package com.charactereducation.eureka.serviceprovideractivitycenter.service;

import com.charactereducation.dao.ActivityMapper;
import com.charactereducation.module.vo.Activity;
import com.charactereducation.tools.def.Constant;
import com.charactereducation.tools.myRunTime.MyRunTimeExcption;
import com.charactereducation.webcore.service.ServiceBase;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by Baggio on 2019-1-22.
 */
@Service
public class ActivityServiceImpl extends ServiceBase implements ActivityService {
    @Autowired
    ActivityMapper activityMapper;

    @Override
    public void modifyActivity(Activity activity) throws MyRunTimeExcption {

    }

    @Override
    public Activity getActivityById(Long activityId) throws MyRunTimeExcption {

        Activity activity = new Activity();
        activity.setCreateTime(new Date());
        activity.setTid(1L);
        activity.setName("测试活动");
        if(activityId!=1L){
            throw new MyRunTimeExcption(8001,"activityIderro");
        }
        return activity;
    }

    @Override
    public List<Activity> getActivityListByIds(List<Long> activityIds) throws MyRunTimeExcption {

        return null;
    }

    @Override
    public List<Activity> getActivityListByType(Byte activityType) throws MyRunTimeExcption {
        return null;
    }

    @Override
    public List<Activity> getActivityList(Map<String, String> map) throws MyRunTimeExcption {
        logger.info("getActivityListPageINfo====================================>>>>" + map.toString());

        return activityMapper.getActivityList(map);
    }
}
